<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
		<script src='https://cdn.bootcss.com/echarts/3.4.0/echarts.js'></script>
		<script src="js/ecStat.min.js"></script>
	</head>

	<body>
		<div id="main" style="width: 100%;height:800px;"></div>
	</body>

	<script>
		function formatDate(date, format) {
			if(format == null) {
				format = 'yyyy/MM/dd h:m:s:S'
			}
			date = new Date(date);
			var map = {
				"M": date.getMonth() + 1, // 月份
				"d": date.getDate(), // 日
				"h": date.getHours(), // 小时
				"m": date.getMinutes(), // 分
				"s": date.getSeconds(), // 秒
				"q": Math.floor((date.getMonth() + 3) / 3), // 季度
				"S": date.getMilliseconds()
				// 毫秒
			};
			format = format.replace(/([yMdhmsqS])+/g, function(all, t) {
				var v = map[t];
				if(v !== undefined) {
					if(all.length > 1) {
						v = '0' + v;
						v = v.substr(v.length - 2);
					}
					return v;
				} else if(t === 'y') {
					return(date.getFullYear() + '').substr(4 - all.length);
				}
				return all;
			});
			return format;
		};

		#xxData#

		var dataNames=[]
		var dataTime = []
		var moreData = []
		for(let i = 0; i < xxData.length; i++) {
			var fundInfo = xxData[i][0]
			dataNames.push(fundInfo.name)
			var oneFundData = []
			var data=fundInfo.data
			console.log(data.length)
			for(let j = 0; j < data.length; j++) {
				if(i==0){
					let curDate = formatDate(data[j][0], 'yyyy/MM/dd')
					dataTime.push(curDate)
				}
				oneFundData.push(data[j][1])
				
			}
			
			moreData.push({name: fundInfo.name,type: 'line',stack: '总量',data: oneFundData})
		}
		
		var option = {
			title: {
				text: ''
			},
			tooltip: {
				trigger: 'axis'
			},
			legend: {
				data: dataNames
			},
			grid: {
				top: '30%',
				left: '3%',
				right: '4%',
				bottom: '3%',
				containLabel: true
			},
			toolbox: {
				feature: {
					saveAsImage: {}
				}
			},
			xAxis: {
				type: 'category',
				boundaryGap: false,
				data: dataTime
			},
			yAxis: {
				type: 'value'
			},
			series: moreData
		};

		// 基于准备好的dom，初始化echarts实例
		var myChart = echarts.init(document.getElementById('main'));
		// 使用刚指定的配置项和数据显示图表。
		myChart.setOption(option);

	
	</script>

</html>